<#include "EventCommonVisit.ftl">
package ${packageName};

import org.jow.core.interfaces.IEvent;
import org.jow.core.support.Param;
<#if importPackages??>
<#list importPackages as package>
import ${package};
</#list>
</#if>
import org.jow.core.gen.JowGenFile;

${mainAnnotation}
@JowGenFile
public final class ${eventName} implements IEvent {

	<#list subkeys as subkey>
	/** ${subkey.comment} */
	public static final String ${subkey.name} = "${subkey.name}";
	</#list>

	<#list fields as field>
	/** ${field.comment} */
	private ${field.type} ${field.name};
	</#list>

	@Override
	public int getKey() {
		return EventKey${suffix}.${eventKey};
	}
	
	@Override
	public Param toParam() {
		Param param = new Param();
	<#list fields as field>
		param.put("${field.name}", ${field.name});
	</#list>
		return param;
	}
	
	public ${eventName}(<#list fields as field><#if (field_index>0)>,${field.type} ${field.name}<#else>${field.type} ${field.name}</#if></#list>)  {
	<#list fields as field>
		this.${field.name} = ${field.name};
	</#list>
	}

	<#-- get和set方法 -->
	<@getAndSetField fields=fields/>

}